Skip to content

Add packetizer cocotb regression coverage#1425

Draft
bengineerd wants to merge 14 commits into
coaxpress-tests-2from
packetizer-tests
Draft

Add packetizer cocotb regression coverage#1425
bengineerd wants to merge 14 commits into
coaxpress-tests-2from
packetizer-tests

Conversation

@bengineerd

@bengineerd bengineerd commented May 28, 2026

Copy link
Copy Markdown
Contributor

Description

Adds focused cocotb regression coverage for the AXI Stream packetizer family, including byte packing, packetizer/depacketizer, packetizer2/depacketizer2, CRC/error handling, link-drop behavior, loopback behavior, and sequence wrap handling.

Details

This packetizer-focused slice adds thin VHDL wrappers under protocols/packetizer/wrappers/ so cocotb can drive and observe the existing RTL through flattened AXI Stream ports without embedding stimulus in VHDL. The wrappers cover:

  • AxiStreamBytePacker
  • AxiStreamPacketizer and AxiStreamDepacketizer
  • AxiStreamPacketizer2 and AxiStreamDepacketizer2
  • a packetizer2 loopback topology for end-to-end packetize/depacketize checks

The new Python regression support under tests/protocols/packetizer/ adds shared packetizer helpers and directed tests for:

  • byte-width packing, alignment, frame boundaries, and sideband preservation;
  • packetizer/depacketizer payload round trips;
  • packetizer2/depacketizer2 framing, route/sideband handling, CRC behavior, and EOFE/error cases;
  • link-drop behavior and sequence-number wrap cases;
  • packetizer2 loopback recovery through the wrapped topology.

The branch also adds/updates regression planning notes for the packetizer work under docs/plans/rtl-regression/.

Merge after #1414.

bengineerd added 14 commits May 3, 2026 00:23
- Introduced tests for reset behavior in FIFO and RAM modules, ensuring proper handling of pending entries and state clearing.
- Added tests for simultaneous read/write operations in FIFO and RAM, verifying correct data handling during collisions and near-full conditions.
- Implemented tests for starvation resistance in arbiters, ensuring fair request handling under contention.
- Enhanced watchdog tests to cover chattered keepalive sequences, ensuring timeout behavior is correctly implemented.
- Added cross-port collision tests in dual-port RAM, verifying correct data visibility and handling during simultaneous writes.
- Introduced burst read gap tests in synchronizer FIFO, ensuring proper data transfer during paused reads and reset conditions.
…VHDL description header:

maxCount is intended to be programmed during init or reset.

If changed at runtime, assert rst afterward.

Discard output history for at least one newly configured delay interval before relying on dout.

Added a fuller module description covering RAM mode, address wrapping, en, DO_REG_G, and delay formula.

Also aligned test_SlvDelayRam.py with that contract: it now reprograms maxCount, resets, discards the post-reset history interval, then verifies stable traffic at the new delay.
- Introduced `AxiStreamDepacketizer2Wrapper.vhd` to provide a Cocotb-facing interface for the `surf.AxiStreamDepacketizer2` entity.
- Introduced `AxiStreamPacketizer2Wrapper.vhd` to provide a Cocotb-facing interface for the `surf.AxiStreamPacketizer2` entity.
- Created test utilities in `packetizer_test_utils.py` to facilitate testing of AXI Stream interfaces.
- Implemented tests for the `AxiStreamDepacketizer2` in `test_AxiStreamDepacketizer2.py` to validate packet processing and output correctness.
- Implemented tests for the `AxiStreamPacketizer2` in `test_AxiStreamPacketizer2.py` to ensure proper packetization of input streams.
- Added an `__init__.py` file to the `tests/protocols/packetizer` directory for package initialization.
… handling

- Updated AxiStreamBytePackerWrapper to support configurable slave and master byte widths.
- Adjusted input and output signal definitions to reflect new byte-width parameters.
- Added assertions to ensure master byte width is not less than slave byte width.
- Modified test_AxiStreamBytePacker to accommodate various input/output byte-width pairs.
- Introduced new tests for edge cases, including idle gaps and output ready signal handling.
- Enhanced test coverage for AxiStreamDepacketizer and AxiStreamPacketizer to validate new functionality.
- Added tests for split sequences, partial last beats, and interleaved destination states.
- Implemented AxiStreamPacketizer2LoopbackWrapper in VHDL to facilitate loopback testing between packetizer and depacketizer.
- Enhanced packetizer and depacketizer test utilities with backpressure handling.
- Added tests for packetizer and depacketizer to validate behavior under various conditions, including CRC modes and backpressure scenarios.
- Introduced a new test for the loopback wrapper to ensure proper handling of split frames and backpressure.
- Updated existing tests to improve coverage and ensure compliance with new functionality.
- Implemented `test_AxiStreamDepacketizer2Crc.py` to validate CRC error handling in the AxiStream depacketizer.
- Created `test_AxiStreamDepacketizer2LinkDrop.py` to check link drop behavior during frame processing.
- Enhanced `test_AxiStreamPacketizer.py` to utilize new assertion functions for packetized beats.
- Updated `test_AxiStreamPacketizer2.py` to include tests for packetization with sequence counter wrapping.
- Introduced `test_AxiStreamPacketizer2Loopback.py` to validate loopback functionality with various destination settings.
- Added `test_AxiStreamPacketizer2SeqWrap.py` to verify sequence counter wrapping behavior in packetization.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 59 out of 60 changed files in this pull request and generated 2 comments.

Comment on lines +20 to +29
rxErrorCodeEnum = {
0x0: 'None',
0x1: 'BadControl',
0x2: 'Overwrite',
0x3: 'IdleError',
0x4: 'PayloadAbort',
0x5: 'SeqMismatch',
0x6: 'HkpMalformed',
0x7: 'HkpBadKCode',
}
Comment on lines +11 to +14
# Test methodology:
# - Sweep: Use the standalone `AxiStreamPacketizer2` wrapper in CRC-disabled
# mode with an 8-byte stream width and a reduced packet-size limit for the
# split-frame case.
@bengineerd bengineerd changed the base branch from pre-release to coaxpress-tests-2 June 8, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants